home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / basic / pbc_bas.exe / IDFILE.BAS < prev    next >
BASIC Source File  |  1993-01-01  |  14KB  |  298 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |        PBClone  Copyright (c) 1990-1993  Thomas G. Hanlin III        |
  4. '   |                                                                      |
  5. '   +----------------------------------------------------------------------+
  6.  
  7.    DECLARE SUB FClose1 (BYVAL FileHandle%)
  8.    DECLARE SUB FOpen1 (FileName$, BYVAL ReadWrite%, BYVAL Sharing%, FileHandle%, ErrCode%)
  9.    DECLARE SUB SFRead (BYVAL FileHandle%, St$, BytesRead%, ErrCode%)
  10.  
  11. SUB IdentifyFile (FileName$, Description$, DescriptionLen%)
  12.  
  13.    File$ = UCASE$(FileName$)
  14.    IF RIGHT$(File$, 1) = CHR$(0) THEN
  15.       File$ = LEFT$(File$, LEN(File$) - 1)
  16.    END IF
  17.  
  18.    Tmp% = INSTR(File$, ".")
  19.    IF Tmp% THEN
  20.       Extension$ = MID$(File$, Tmp% + 1)
  21.    ELSE
  22.       Extension$ = ""
  23.    END IF
  24.  
  25.    D$ = ""
  26.    DetailedCheck% = 0
  27.  
  28.    SELECT CASE Extension$
  29.       CASE "$$$": D$ = "temporary pipe file"
  30.       CASE "@@@": D$ = "backup ID file"
  31.       CASE "$$$": D$ = "temporary or backup file"
  32.       CASE "ACT": D$ = "program source code (Actor) or comm account data (BITCOM)"
  33.       CASE "AIO": D$ = "APL file transfer format file"
  34.       CASE "AMG": D$ = "system image file (Actor)"
  35.       CASE "ANS": D$ = "text file containing IBM ANSI display codes"
  36.       CASE "APL": D$ = "APL work space format file"
  37.       CASE "APP": D$ = "application file (SQLWindows)"
  38.       CASE "ARC": DetailedCheck% = -1
  39.       CASE "ARF": D$ = "response file created by a Microsoft compiler"
  40.       CASE "ARJ": D$ = "compressed library of files (ARJ)"
  41.       CASE "ASC": D$ = "ASCII (text) file"
  42.       CASE "ASM": D$ = "assembly language source code"
  43.       CASE "BAK": D$ = "backup copy of a file"
  44.       CASE "BAS": DetailedCheck% = -1
  45.       CASE "BAT": D$ = "executable code (DOS batch language)"
  46.       CASE "BI" : D$ = "includeable source code for compiled BASIC"
  47.       CASE "BIN": D$ = "binary data file"
  48.       CASE "BLK": D$ = "block info file (Show Partner)"
  49.       CASE "BMP": D$ = "picture file (MS Windows)"
  50.       CASE "C"  : D$ = "C source code"
  51.       CASE "CAL": D$ = "calendar data (MS Windows) or spreadsheet file (SuperCalc)"
  52.       CASE "CAP": D$ = "captions (Ventura Publisher)"
  53.       CASE "CCL": D$ = "comm command language file (Intalk)"
  54.       CASE "CDR": D$ = "picture (Corel Draw)"
  55.       CASE "CFG": D$ = "configuration, initialization or setup file"
  56.       CASE "CGM": D$ = "picture"
  57.       CASE "CHK": D$ = "file recovered by CHKDSK"
  58.       CASE "CHP": D$ = "chapter (Ventura Publisher)"
  59.       CASE "CIF": D$ = "chapter information (Ventura Publisher)"
  60.       CASE "CLR": D$ = "color palette (Show Partner)"
  61.       CASE "CLS": D$ = "class library file (Actor)"
  62.       CASE "CMD": D$ = "executable code (CP/M-86 or OS/2) or program (dBASE)"
  63.       CASE "CMP": D$ = "word comparison file (MS Word)"
  64.       CASE "CNF": D$ = "configuration, initialization or setup file"
  65.       CASE "COB": D$ = "COBOL source code"
  66.       CASE "COD": D$ = "FORTRAN compiled code"
  67.       CASE "COM": DetailedCheck% = -1
  68.       CASE "COL": D$ = "spreadsheet (MS Multiplan)"
  69.       CASE "CPL": D$ = "control panel applet (MS Windows)"
  70.       CASE "CPP": D$ = "C++ source code"
  71.       CASE "CRD": D$ = "index card file (MS Windows)"
  72.       CASE "CRF": D$ = "cross-reference listing"
  73.       CASE "CRS": D$ = "golf course data file (World Tour Golf)"
  74.       CASE "CTX": D$ = "course text file for a tutorial (Microsoft)"
  75.       CASE "CUR": D$ = "cursor definition (MS Windows)"
  76.       CASE "DAT": D$ = "data file"
  77.       CASE "DB" : D$ = "database file (Paradox)"
  78.       CASE "DBD": D$ = "demonstration data (Norton)"
  79.       CASE "DBF": D$ = "database file (dBASE)"
  80.       CASE "DBS": D$ = "database file (SQLWindows)"
  81.       CASE "DBT": D$ = "text file (dBASE)"
  82.       CASE "DCA": D$ = "text file (IBM)"
  83.       CASE "DCT": D$ = "spelling dictionary"
  84.       CASE "DEF": D$ = "definitions or defaults file"
  85.       CASE "DEV": D$ = "device driver"
  86.       CASE "DFM": D$ = "data entry form (Palantir Filer)"
  87.       CASE "DGI": D$ = "picture (Digi-Pic)"
  88.       CASE "DGS": D$ = "diagnostics file (PC-DOS)"
  89.       CASE "DIB": D$ = "device-independent bitmap (MS Windows)"
  90.       CASE "DIC": D$ = "spelling dictionary"
  91.       CASE "DIF": D$ = "data interchange format file"
  92.       CASE "DIR": D$ = "dialing directory (phone book)"
  93.       CASE "DIS": D$ = "start-up file (Q&A)"
  94.       CASE "DLL": D$ = "dynamic link library (MS Windows)"
  95.       CASE "DOC": D$ = "document, documentation or a manual (text file)"
  96.       CASE "DOT": D$ = "tutorial (Microsoft)"
  97.       CASE "DOX": D$ = "document (MultiMate)"
  98.       CASE "DRV": D$ = "device driver"
  99.       CASE "DRW": D$ = "picture (Micrografx)"
  100.       CASE "DTA": D$ = "data file"
  101.       CASE "DTF": D$ = "database (PFS or Q&A)"
  102.       CASE "DWC": D$ = "compressed library of files (DWC)"
  103.       CASE "EMU": D$ = "terminal emulation data (BITCOM)"
  104.       CASE "EPS": D$ = "picture (Encapsulated PostScript)"
  105.       CASE "ERR": D$ = "error code data"
  106.       CASE "EXE": DetailedCheck% = -1
  107.       CASE "FAC": D$ = "character font (LePrint)"
  108.       CASE "FLI": D$ = "animation file (Animator)"
  109.       CASE "FMT": D$ = "screen format (dBASE)"
  110.       CASE "FNT": D$ = "character font"
  111.       CASE "FON": D$ = "character font or phone book"
  112.       CASE "FOO": D$ = "temporary or miscellaneous file"
  113.       CASE "FOR": D$ = "FORTRAN source code"
  114.       CASE "FRM": D$ = "report layout (dBASE)"
  115.       CASE "GEM": D$ = "picture (GEM draw)"
  116.       CASE "GIF": D$ = "picture (CompuServe format)"
  117.       CASE "GRB": D$ = "snapshot or 'grab file' (MS Windows)"
  118.       CASE "GRF": D$ = "graph (Micrografx)"
  119.       CASE "GRP": D$ = "group definition (MS Windows)"
  120.       CASE "GUI": D$ = "guide document (Guide)"
  121.       CASE "GX1": D$ = "picture (Show Partner)"
  122.       CASE "H"  : D$ = "C header file"
  123.       CASE "HEX": D$ = "hex dump file (DEBUG)"
  124.       CASE "HLP": D$ = "help file"
  125.       CASE "HP" : D$ = "graphics (Hewlett-Packard)"
  126.       CASE "HPP": D$ = "C++ header file"
  127.       CASE "HXX": D$ = "C++ header file"
  128.       CASE "ICO": D$ = "icon definition (MS Windows)"
  129.       CASE "IDX": D$ = "index file"
  130.       CASE "IMG": D$ = "picture (GEM paint, ISF, WPS, et al)"
  131.       CASE "IMP": D$ = "implementation file (IBM Pascal)"
  132.       CASE "INC": D$ = "includeable source code"
  133.       CASE "INI": D$ = "configuration, initialization or setup file"
  134.       CASE "INF": D$ = "library definition file (LibWiz)"
  135.       CASE "INT": D$ = "implementation file (IBM Pascal) or command file (XyWrite)"
  136.       CASE "ION": D$ = "description of files"
  137.       CASE "IT" : D$ = "settings file (Intalk)"
  138.       CASE "JOR": D$ = "journal (SQLWindows)"
  139.       CASE "KBD": D$ = "keyboard configuration (XyWrite)"
  140.       CASE "KEX": D$ = "Kexx/Rexx source code (KEDIT)"
  141.       CASE "KEY": D$ = "keyboard definition file"
  142.       CASE "LAY": D$ = "keyboard configuration (SuperKey)"
  143.       CASE "LBL": D$ = "label description (dBASE)"
  144.       CASE "LBR": D$ = "library of files"
  145.       CASE "LIB": D$ = "linkable code library"
  146.       CASE "LST": D$ = "listing"
  147.       CASE "LZH": D$ = "compressed library of files"
  148.       CASE "MAC": D$ = "picture (MacIntosh) or keyboard macro (ProKey, SuperKey)"
  149.       CASE "MAN": D$ = "documentation or a manual"
  150.       CASE "MAP": D$ = "memory map (LINK)"
  151.       CASE "MDM": D$ = "modem information (Access)"
  152.       CASE "MEM": D$ = "memory file (dBASE)"
  153.       CASE "MID": D$ = "sound data in MIDI format (MS Windows)"
  154.       CASE "MNU": D$ = "menu definition (Access)"
  155.       CASE "MOD": D$ = "modifications list, Modula-2 source code, or music file"
  156.       CASE "MSG": D$ = "message file (MS Multiplan, Sidekick)"
  157.       CASE "MSP": D$ = "picture (MS Windows)"
  158.       CASE "NDX": D$ = "index file"
  159.       CASE "NET": D$ = "network configuration (Paradox)"
  160.       CASE "NEW": D$ = "new information (text)"
  161.       CASE "NOT": D$ = "notice (text)"
  162.       CASE "OBJ": D$ = "object code"
  163.       CASE "O"  : D$ = "object code (non-standard form)"
  164.       CASE "OLD": D$ = "backup file (Microsoft)"
  165.       CASE "OVD": D$ = "e